﻿#include "mainwindow.h"
#include "ui_mainwindow.h"
#include<QPainter>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    //退出
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::paintEvent(QPaintEvent *event)
{
    //设置背景
    QPainter painter(this);
    QPixmap pix;
    pix.load(":/image/mainbj.jpg");
    //pix.scaled(this->size());
    painter.drawPixmap(0,0,this->width(),this->height(),pix);
}

void MainWindow::on_btn_exit_clicked()
{
    exit(0);
}

//开始按钮
void MainWindow::on_btn_start_clicked()
{

    l.show();
    this->hide();
}

